function cal(num: string | number) {
  if (isNum(num)) {
    console.log(num.toFixed(2));
  } else {
    console.log(num.length);
  }
}

function isNum(num: any): num is number {
  return typeof num === "number";
}

export {};
